import { DialogConfig } from '@/components/mm-dialog/type'

export const dialogConfig: DialogConfig = {
  width: 680,
  showLabel: true,
  labelWidth: 80,
  layout: [
    {
      formItems: [
        {
          label: '姓名',
          prop: 'name',
          type: 'input',
          placeholder: '请输入姓名',
          rules: [
            { required: true, message: '必填项不能为空', trigger: 'blur' },
            { max: 16, message: '不能超过 16 个字符', trigger: 'blur' }
          ]
        }
      ]
    },
    {
      formItems: [
        {
          label: '手机号码',
          prop: 'cellphone',
          type: 'input',
          placeholder: '请输入手机号码',
          rules: [
            { required: true, message: '必填项不能为空', trigger: 'blur' },
            { pattern: /^1[3|4|5|6|7|8|9][0-9]{9}$/, message: '手机号码格式有误', trigger: 'blur' }
          ]
        }
      ]
    },
    {
      formItems: [
        {
          label: '性别',
          prop: 'gender',
          type: 'radio',
          placeholder: '请选择性别',
          options: [
            { label: '男', value: 0 },
            { label: '女', value: 1 }
          ],
          rules: [{ required: true, message: '必填项不能为空', trigger: 'change', type: 'number' }]
        }
      ]
    },
    {
      formItems: [
        {
          label: '状态',
          prop: 'status',
          type: 'switch',
          bind: {
            inactiveValue: 0,
            activeValue: 1
          }
        }
      ]
    },
    {
      formItems: [
        {
          label: '备注',
          prop: 'remarks',
          type: 'textarea',
          placeholder: '请输入备注',
          bind: {
            rows: 3
          }
        }
      ]
    }
  ]
}
